cmake_minimum_required(VERSION 2.8)
project(engine)

set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wno-invalid-source-encoding")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-invalid-source-encoding")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

add_definitions("-m64 -g -Wall -Wno-overloaded-virtual -fstack-protector -fstack-protector-all -Wno-unused-private-field -Wno-unused-value -Wno-reorder -Wno-unused-variable")

set(ENGINE_LIBS -lpthread
		  -lrt
		  -ldl
		  libprotobuf.a
	  	  libkratos_core.a
)
aux_source_directory(. ENGINE_SRC)
aux_source_directory(./thirdparty/kconfig/internal ENGINE_SRC)

LINK_DIRECTORIES(
 /usr/local/lib/
 /usr/lib/
 /usr/lib64/
)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

add_executable(
	engine
	${ENGINE_SRC}	
)

target_link_libraries(
	engine
	${ENGINE_LIBS}
)

INSTALL(TARGETS engine DESTINATION bin)
